<template>
	<view class="p-item">
		<view class="img-box">
			<image :src="item.image"></image>
		</view>
		<view class="info">
			<view class="name">{{item.store_name}}</view>
			<view class="jfp flex">
				<text class="jf">{{item.integral}}积分</text>
				<text class="price">{{item.price}}元</text>
			</view>
			<view class="hs">回收预估价格{{item.recycling_price}}元

			</view>
			<text class="changed">已兑换{{item.sales}}+单</text>
			<view class="change-button">立即兑换</view>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		item: Object
	})
</script>

<style scoped lang="scss">
	.p-item {
		width: 346rpx;
		margin-top: 10px;
		background-color: #fff;
		border-radius: 10px;

		.img-box {
			position: relative;
			width: 100%;
			height: 173px;

			image {
				width: 100%;
				height: 100%;
				border-radius: 9px 9px 0px 0px;
			}
		}

		.info {
			padding-left: 8px;

			.name {
				display: flex;
				font-size: 14px;
				height: 40px;
				color: #333;
				padding-right: 4px;
				margin-top: 4px;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				display: -moz-box;
				-moz-line-clamp: 2;
				-moz-box-orient: vertical;
				word-wrap: break-word;
				word-break: break-all;
				white-space: normal;
				overflow: hidden;
			}
		}

		.jfp {
			.jf {
				margin-top: 6px;
				font-weight: 500;
				font-size: 16px;
				color: $themeColor;
			}

			.price {
				margin-left: 5px;
				margin-top: 8px;
				font-weight: 400;
				font-size: 12px;
				color: #999;
				-webkit-text-decoration-line: line-through;
				text-decoration-line: line-through;
			}
		}

		.hs {
			display: flex;
			font-weight: 400;
			font-size: 12px;
			color: #666;
		}

		.changed {
			display: flex;
			font-weight: 400;
			font-size: 10px;
			color: #999;
			text-align: right;
		}

		.change-button {
			display: flex;
			text-align: center;
			align-items: center;
			justify-content: center;
			margin-top: 19px;
			width: 163px;
			height: 40px;
			background: #3061bf;
			border-radius: 20px 20px 20px 20px;
			color: #fff;
			font-size: 14px;
			margin-bottom: 8px;
		}
	}
</style>